package com.cn.mvc.pojo;

import java.lang.reflect.Method;
import java.util.*;
import java.util.regex.Pattern;

public class Handle {
    // 存储controller对象
    private Object controller;
    // 存储 方法
    private Method method;
    // 正则表达式
    private Pattern pattern;
    // 存储参数位置
    private Map<String, Integer> param;

    private boolean checkSecurity = false;
    // 权限组 可以访问的用户
    private Set<String> security;

    public Handle(Object controller, Method method, Pattern pattern) {
        this.controller = controller;
        this.method = method;
        this.pattern = pattern;
        this.param = new HashMap<>();
        this.security = new HashSet<>();
    }

    public Object getController() {
        return controller;
    }

    public void setController(Object controller) {
        this.controller = controller;
    }

    public Method getMethod() {
        return method;
    }

    public void setMethod(Method method) {
        this.method = method;
    }

    public Pattern getPattern() {
        return pattern;
    }

    public void setPattern(Pattern pattern) {
        this.pattern = pattern;
    }

    public Map<String, Integer> getParam() {
        return param;
    }

    public void setParam(Map<String, Integer> param) {
        this.param = param;
    }

    public Set<String> getSecurity() {
        return security;
    }

    public void setSecurity(Set<String> security) {
        this.security = security;
    }

    public boolean isCheckSecurity() {
        return checkSecurity;
    }

    public void setCheckSecurity(boolean checkSecurity) {
        this.checkSecurity = checkSecurity;
    }
}
